package cn.tedu.mall1.product.controller;

import cn.tedu.mall1.base.response.JsonResult;
import cn.tedu.mall1.product.pojo.dto.ProductDTO;
import cn.tedu.mall1.product.pojo.vo.ProductVO;
import cn.tedu.mall1.product.service.ProductService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/v1/product")
public class ProductController {
    @Autowired
    ProductService productService;

    @GetMapping("/select")
    private JsonResult select(ProductVO productVO){
        log.debug("查询商品ID,productId{}----",productVO);
        List<ProductDTO> productDTO = productService.select(productVO);
        return JsonResult.ok(productDTO);

    }
}
